import face_recognition
import cv2
image = face_recognition.load_image_file("lakers.jpg")
face_locations = face_recognition.face_landmarks(image)
facenum = len(face_locations)
for i in range(0, facenum):
    top =  face_locations[i][0]
    right =  face_locations[i][1]
    bottom = face_locations[i][2]
    left = face_locations[i][3]
    start = (left, top)
    end = (right, bottom)
    color = (0, 0, 255)
    thickness = 2
    cv2.rectangle(image, start, end, color, thickness)

cv2.namedWindow(u"识别")
cv2.imshow(u"识别", image)

cv2.waitKey(0)
cv2.destroyAllWindows()